package com.hengpeng.itfin.common;

import java.io.UnsupportedEncodingException;

import com.hengpeng.common.config.ConfigManager;

public class Configuration
{
	private static String decodeUrl = null;
	static
	{
		try
		{
			decodeUrl = java.net.URLDecoder.decode(Configuration.class.getResource("/").getPath(), "utf-8")
					+ "config/service.properties";
		}
		catch (UnsupportedEncodingException e)
		{
			e.printStackTrace();
		}
		ConfigManager.setPropertiesPathConfig(decodeUrl, decodeUrl, false);
	}

	public static String getValue(String key)
	{
		return ConfigManager.getPropertiesConfig(decodeUrl).getConfigByKey(key);
	}

	public static Long getLong(String key)
	{
		return Long.valueOf(ConfigManager.getPropertiesConfig(decodeUrl).getConfigByKey(key));
	}
}
